package com.shop.resource.controller;

import com.shop.resource.api.ISmsApi;
import com.shop.resource.service.ISmsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Description:
 *
 * @author zhoulk
 * @date: 2019年05月08日  17:33
 */
@RestController
public class SmsController implements ISmsApi {

    private static final Logger logger = LoggerFactory.getLogger(SmsController.class);

    @Autowired
    ISmsService smsService;

    @Override
    public Map<String, Object> sendSmsCode(String code, String mobile) {
        logger.info("发送短信验证码   code:"+code+" -- mobile:"+mobile);
        return smsService.sendSmsCode(code,mobile);
    }

    @Override
    public Map<String, Object> sendSmsMsg(@RequestParam("content") String content, @RequestParam("mobile") String mobile) {
        logger.info("发送短信通知   content:"+content+" -- mobile:"+mobile);
        return smsService.sendSmsMsg(content,mobile);
    }
}
